home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / tpega.zip / TPEGA.DOC < prev    next >
Text File  |  1986-04-14  |  49KB  |  1,551 lines

  1.  
  2.                                                         DATE:   02/25/86
  3.                                                         SYSTEM: KC-TPEGA
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.               Graphics for the IBM's Enhance Graphic Adapter (EGA)
  20.  
  21.  
  22.                               Version 02/25/86
  23.  
  24.  
  25.                            for Microsoft C 3.00+
  26.  
  27.                                    and
  28.  
  29.                             Turbo Pascal 3.01A+
  30.  
  31.  
  32.                                                         DATE:   02/03/86
  33.                                                         SYSTEM: KC-TPEGA
  34.  
  35.  
  36.  
  37.                                  IMPORTANT NOTICE
  38.  
  39.  
  40.         The Enhanced Graphic Adapter (EGA) graphic routines for Microsoft
  41.         3.0 and Turbo Pascal 3.01A was written and is maintained by:
  42.  
  43.                                Kent Cedola
  44.                                2015 Meadow Lake Court
  45.                                Norfolk, Virginia  23518
  46.                                1-(804)-857-0613
  47.  
  48.         Users of this software are encouraged to copy and distribute the
  49.         graphics library and demonstrations programs which are a part of
  50.         this package for non-commericial purposes.
  51.  
  52.         No fee or other charges may be made in the distribution of these
  53.         programs without the written permission from Kent Cedola.
  54.  
  55.         Any program written with this graphic library may be sold, as
  56.         long as the source code for the graphic library in not included.
  57.         If you wish to include the graphic library with the product,
  58.         please contact me for more information and written permission.
  59.  
  60.         The date of release will be used in instead of a version.  When
  61.         requesting information, please included the date (version) of the
  62.         copy that you have and the amount of EGA memory.  Write the above
  63.         for the current release of the graphic library.
  64.  
  65.         If you are satified with the EGA support for Turbo Pascal you are
  66.         asked to send a donation of $20.00 dollars.  All registered users
  67.         will be informed of any major improvements and/or programs
  68.         developments.
  69.  
  70.                                 FREE COPY OF TPEGA
  71.  
  72.         If you send a diskette with a SASE, I will send you the current
  73.         copy of the library and programs for FREE! (360k or 1.2meg disk)
  74.  
  75.  
  76.                                                         DATE:   02/03/86
  77.                                                         SYSTEM: KC-TPEGA
  78.  
  79.  
  80.  
  81.                                       GENERAL
  82.  
  83.  
  84.         This graphic software was written to provide the general public
  85.         a means for writing graphic program for the EGA without any run-
  86.         time fee!  The software is also design to give the programmer
  87.         the most flexibility, so most graphic routines can be changed or
  88.         deleted (saving space) from the final product.
  89.  
  90.         Those with the standard EGA (only 64k of memory) may have some
  91.         problems with some of the graphic primitives as I have a 128k+
  92.         EGA.  I highly recommend adding extra memory to your EGA if
  93.         you plan to do alot of graphic programming.
  94.  
  95.  
  96.                                                         DATE:   02/03/86
  97.                                                         SYSTEM: KC-TPEGA
  98.  
  99.  
  100.                                 SPECIAL NOTICE
  101.  
  102.  
  103.         While trying to get as many graphic routines as possible in this
  104.         release I had to cut corners on the GPSHADE, GPFILL and GPFLOOD
  105.         graphic primitives.  The GPFILL should be used for simple objects
  106.         to be filled in and GPFLOOD for complex objects. Currently, GPFILL
  107.         calls GPFLOOD to do the fill, this will change in the future as I
  108.         will write a version of GPFILL that will execute two or three times
  109.         faster than GPFLOOD (GPFILL = Simple objects only).  GPSHADING has
  110.         a restriction for dimensions of 1,2,4 or 8 or both width and height.
  111.         Other dimensions can be used, but funny fills may happen (will be
  112.         fixed later).  The GPFLOOD routine is fast, and will fill in any
  113.         area no matter how complex (more complex more stack space), but I
  114.         will re-write it for higher speeds.
  115.  
  116.         Both the GPBOX and GPBALL primitives only do solid colors and not
  117.         shades.  Both use special EGA full byte fill modes and are fast.
  118.         BPBOX and GPBALL do NOT set the clipping flag. (Later)
  119.  
  120.         These primitives do work, but they can be better.  I will improve
  121.         the flexibility and speed of these routines in the future.
  122.  
  123.         The following routines miss this release (are in the documentation)
  124.         will be included in a future release.
  125.  
  126.                         GPSCROLL
  127.                         GPPOLY
  128.  
  129.  
  130.                                                         DATE:   02/03/86
  131.                                                         SYSTEM: KC-TPEGA
  132.  
  133.  
  134.                         List of Graphic Functions
  135.  
  136.  
  137.          Graphics Routines               Description
  138.         ----------------------------    ---------------------------------
  139.          GPPARMS;                        Setup graphic adapter parameters
  140.          GPINIT;                         Initialize graphic display
  141.          GPTERM;                         Terminate graphic display
  142.  
  143.          GPCOLOR(b);                     Set current color
  144.          GPMERGE(b);                     Set current merge mode
  145.          GPSTYLE(array);                 Set pattern for drawing lines
  146.          GPSHADE(array);                 Set pattern for shading areas
  147.          GPRDCLR;                        Return the current color
  148.  
  149.          GPPAL(p,v);                     Set a palette register
  150.          GPCPAL(p,v);                    Set a palette register using RGB
  151.          GPLDPAL(array);                 Load all palette registers
  152.          GPRDPAL(p);                     Read current palette setting
  153.  
  154.          GPPLOT(X,Y);                    Plot a point at X,Y (sets new CP)
  155.          GPRDDOT(X,Y)                    Read pixel at coordinates (X,Y)
  156.          GPMOVE(X,Y);                    Set current graphic position (CP)
  157.          GPLINE(X,Y);                    Draw a line from (CP) to X,Y
  158.          GPPOLY(array,N);                Draw a N number of lines
  159.          GPRECT(X,Y);                    Draw a rectangle between CP and (X,Y)
  160.          GPCIR(R);                       Draw a circle at CP with R radius
  161.  
  162.          GPWTROW(Array,N);               Write a row of pixels
  163.          GPWTCOL(Array,N);               Write a column of pixels
  164.          GPRDROW(Array,N);               Read a row of pixels
  165.          GPRDCOL(Array,N);               Read a column of pixels
  166.  
  167.          GPBOX(X,Y);                     Draws a solid box with color/shading
  168.          GPBAL(R);                       Draws a solid circle with color/shading
  169.  
  170.          GPSCROLL(Dir,I,N);              Scroll current viewport
  171.  
  172.          GPVIEWPORT(X1,Y1,X2,Y2);        Set current viewport
  173.          GPWINDOW(X1,Y1,X2,Y2);          Set current window
  174.          GPCLIP1(X,Y);                   Clip point in current window
  175.          GPCLIP2(X1,Y1,X2,Y2);           Clip line in current window
  176.          GPSCALE(X,Y);                   Scale from world to device
  177.  
  178.          GPFILL(Border);                 Simple object fill, color/shading
  179.          GPFLOOD(Border);                Complex object fill, color/shading
  180.  
  181.  
  182.                                                         DATE:   02/03/86
  183.                                                         SYSTEM: KC-TPEGA
  184.  
  185.  
  186.                         List of Global Variables
  187.  
  188.  
  189.          Global Variable                 Description
  190.         ----------------------------    ---------------------------------
  191.          GDTYPE:        Integer;         3 = CG, 4 = Mono, 5 = Color
  192.          GDOTHER:                        Internal Use Only
  193.          GDMEMORY:      Integer;         Amount of memory, 64 -> 256
  194.          GDMAXCOL:      Integer;         Maximum column (639 for EGA)
  195.          GDMAXROW:      Integer;         Maximum row (199/349 fo